home *** CD-ROM | disk | FTP | other *** search
- PROGRAM Demo(input,output,picfile);
-
- { Copyright (c) 1987, Ciarcia's Circuit Cellar }
- { All Rights Reserved }
-
- {$U- control-break checking during execution }
- {$C- control-break checking during I/O operations }
- {$R- array range checking }
-
- {$Ideclares.p declarations }
- {$Ihexutil.p hex utilities }
- {$Iserial.p serial interface code }
- {$Ipictures.p picture file code }
- {$Iimages.p image processing }
-
- VAR
- level : INTEGER; { delta threshold }
- changes : REAL; { # changed threshold }
- npels : REAL; { # actually changed }
- valerror : INTEGER; { error code from Val }
- picswap : picptr; { used to swap buffers }
-
- BEGIN
-
- LowVideo;
-
- ComOn(bitsec); { set up serial port }
-
- pic0 := NIL; { get working buffer }
- PicSetup(pic0);
-
- pic1 := NIL; { get ref pic buffer }
- PicSetup(pic1);
- SetSyncs(pic1); { ... and add controls }
-
- pic2 := NIL; { get test pic buffer }
- PicSetup(pic2);
- SetSyncs(pic2); { ... and add controls }
-
- pic3 := NIL; { get changes buffer }
- PicSetup(pic3);
- SetSyncs(pic3); { ... and add controls }
- (*
- Writeln('Grabbing reference picture...');
- GetPicture(pic0);
- Writeln(' expanding');
- Expand(pic0,pic3);
- *)
- REPEAT
-
- Writeln('Capturing new image...');
- GetPicture(pic0,fullres); { grab test picture }
- Writeln(' displaying');
- SendPicture(pic0);
-
- Writeln(' expanding');
- Expand(pic0,pic1);
-
- IF KeyPressed
- THEN Exit;
-
- Histogram(pic1,histo);
- ShowHist(histo);
-
- Writeln('Finding outlines...');
- Edge(pic1,pic2);
- Writeln(' displaying');
- SendPicture(pic2);
- Writeln(' enhancing');
- Multiply(pic2,3);
- Writeln(' displaying');
- SendPicture(pic2);
-
- IF KeyPressed
- THEN Exit;
- (****
- Writeln('Comparing with previous image...');
- Compare(pic1,pic3,pic2);
- Writeln(' displaying');
- SendPicture(pic2);
- Writeln(' enhancing');
- Multiply(pic2,3);
- Writeln(' displaying');
- SendPicture(pic2);
- ***)
- picswap := pic1;
- pic1 := pic3;
- pic3 := picswap;
-
- UNTIL KeyPressed;
-
- END.